<template>
  <div class="test">test</div>
  <button @click="showpopul">打开弹窗</button>

  <uni-popup ref="populRef" type="bottom">
    <text>esrtdyfugihojpk</text>
    <button @click="closepopul">关闭弹窗</button>
  </uni-popup>
  <button @click="openPayment">打开支付弹窗</button>
  <custom-payment
    :order-id="'888'"
    :amount="99"
    ref="customPaymentRef"
  ></custom-payment>
</template>

<script lang="ts" setup>
// import CustomPayment from "@/components/custom-payment/custom-payment.vue";
import type { CustomPaymentInstance } from "@/types/components";
import { ref } from "vue";
const populRef = ref<UniHelper.UniPopupInstance>();
const showpopul = () => {
  populRef.value?.open?.();
};
const closepopul = () => {
  populRef.value?.close?.();
};

// const customPaymentRef = ref<InstanceType<typeof CustomPayment>>()

// 使用的自定义的全局组件类型
const customPaymentRef = ref<CustomPaymentInstance>();
const openPayment = () => {
  customPaymentRef.value?.open();
};
</script>

<style scoped></style>
